package cn.ali.filter;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

public class MyFilter2Strus2 implements Filter {
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        if (request instanceof HttpServletRequest) {
            HttpServletRequest   httpServletRequest = (HttpServletRequest) request;
            String requestURI = httpServletRequest.getRequestURI();
            if(requestURI.endsWith(".action")){
                response.getWriter().write("this is strus2 result");
                //过滤器不放行
                return;
            }
            chain.doFilter(request,response);

        }

    }

    public void destroy() {

    }
}
